For detecting a motion of an object displayed on an image, the image is horizontally and vertically divided into a plurality of image blocks so as to calculate a motion vector for each of the image blocks. The motion vector indicates a direction, in which each of the image blocks moves.
Specifically, a correlation operation such as pattern matching is performed between an image block obtained by clipping an image at a certain time (a target block) and an image block obtained by clipping an image at different time (a comparative block). The same process is repeated while vertically and horizontally moving the position of the comparative block by one pixel within a search range that is set with respect to the position corresponding to the target block as the center. A comparative block having the largest correlation value of all the obtained correlation values is specified as a destination block or a source block.
In this method, assuming that the number of target blocks obtained by clipping the image is M, the number of pixels in each of the target blocks is L×L, and a range set by adding N pixels around the target blocks is a search range, L2×M×(2N+1)2 correlation operations are required. Therefore, an enormous amount of operations is needed.
For example, assuming that an image contains 640×480 pixels, a target block contains 16×16 pixels, and a search range is±32 pixels, L=16, M=1200 and N=32 are obtained. Accordingly, the amount of correlation operations is about 1.3 G (giga) times for one frame.
In order to reduce the amount of correlation operations, pixels are thinned out to generate a plurality of images with different resolutions. First, a search is made with the image having the lowest resolution. By using the result of the search, the search is repeatedly made with the images having higher resolutions (for example, U.S. Pat. No. 5,276,513 (JP 6-60187 A) and JP 2003-99782 A). However, this method basically uses pattern matching, there arises a problem that the reduction of a large amount of operations cannot be expected even if a hierarchical method is used. Moreover, if the search range is expanded, the amount of operations exponential-functionally increases. Therefore, the search range is limited by operating capacity. As a result, an object with great movement, that is, a fast-moving object cannot be detected.
On the other hand, a method of detecting the amount of movement and a moving direction of an object displayed on a differential image (subtraction image) without using pattern matching is also known. In this method, a background differential image corresponding to a differential image between a pre-prepared background image and an input image is obtained for each frame of the input image. The background differential images are compared between frames so as to extract a region with a difference (a differential region). The amount of movement and a moving direction of a center of gravity of the extracted differential region are obtained (for example, JP 6-14698 B2). In this method, however, a single area center is obtained from the entire image. Therefore, if there are a plurality of objects to be detected, a motion for each of the objects to be detected cannot be detected.
The center of gravity of the differential region is specifically calculated in the following manner. A distribution of the number of pixels contained in the differential region is obtained for an X-coordinate axis and a Y-coordinate axis of two-dimensional coordinates indicative of the position of a pixel. From the distribution, the X-coordinate and the Y-coordinate halving a total number of pixels contained in the differential region, that is, the center of the area of the differential region, are obtained as the center of gravity of the differential region.